<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
<%--    <fmt:setLocale value="en_US"/>--%>
    <meta charset="UTF-8">
    <title>
        <fmt:bundle basename="res">
            <fmt:message key="loginTitle"/>
        </fmt:bundle>
    </title>
    <link rel="stylesheet" type="text/css" href="${web_domain}/resources/login/login.css"/>
    <style>
        body {
            width: 100%;
            height: 100%;
            background: url("${web_domain}/resources/login/login.jpg");
            background-size: 100%;
        }
    </style>
    <script type="text/javascript" src="${web_domain}/resources/plugins/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            if (window != top) {
                top.location.href = location.href;
            }

            var showError = function (msg) {
                $("#error").html(msg);
            };

            $("#username").focus();
            var code = "${param.code}";
            <fmt:bundle basename="res">
            if (code) {
                try {

                    var codeAsInt = parseInt(code, 10);
                    switch (codeAsInt) {
                        case 1:
                            showError("<fmt:message key='zhhmmcw'/>！");
                            break;
                        case 2:
                            showError("<fmt:message key='zhybjzdl'/>！");
                            break;
                        case 4:
                            showError("<fmt:message key='zhhmmcw'/>！");
                            break;
                        case 8:
                            showError("<fmt:message key='yzmcw'/>！");
                            break;
                        case 18:
                            showError("<fmt:message key='qsrzhmm'/>");
                            break;
                        default:
                            showError("<fmt:message key='wzcw'/>！");
                            break;
                    }
                } catch (e) {
                    showError("<fmt:message key='wlyc'/>！");
                }
            }
            </fmt:bundle>
        });
    </script>
</head>
<body>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

<div class="bannerL">
    <div class="login">
        <div class="loginBox">
            <br/>
            <%--<p><img src="${web_domain}/resources/login/logo.png"/></p>--%>
            <form action="${web_domain}/login" method="post" id="user_form">
                <fmt:bundle basename="res">
                <h2><b>
                        <fmt:message key="platformName"/>
                </b></h2>
                <p><img src="${web_domain}/resources/login/account.png"/><input type="text" placeholder="<fmt:message key='qsrglyzh'/>" name="username" id="username"/></p>
                <p><img src="${web_domain}/resources/login/pwd.png"/><input type="password" placeholder="<fmt:message key='qsrglymm'/>" name="password" id="password"/></p>
                <p><img src="${web_domain}/resources/login/pwd.png"/><span><input type="text" style="width: 120px;margin-left: -150px" placeholder="<fmt:message key='qsryzm'/>" name="captcha"/><a href="javascript:void(0);" id="refresh" style="position: absolute;top: -10px;right: 210px; "><img id="captcha" src="${web_domain}/captcha" class="img-polaroid"/></a></span></p>
                <input type="submit" value="<fmt:message key='loginTitle'/>" class="loginBtn" style="margin-top: 30px"/>
                <%--<div style="margin-left: 230px;"><a href="${web_domain}/forget">忘记密码</a></div>--%>
                <div id="error" class="logerror" style="color: red;padding-top: 22px;"></div>
                </fmt:bundle>
            </form>
        </div>
    </div>
</div>

<script>
    $(function () {
        $("#captcha").click(function () {
            var captchaUrl = "${web_domain}/captcha?" + Math.random().toString();
            $(this).attr("src", captchaUrl);
            $("#captchaText").focus();
        });

    })
</script>
</body>
</fmt:bundle>
</html>